package jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;

public class MyResultSetMetaData {
	public static void main(String[] args) throws ClassNotFoundException,
			SQLException {
		Class.forName("oracle.jdbc.driver.OracleDriver");
		System.out.println("Driver loaded successfully");

		Connection con = DriverManager.getConnection(
				"jdbc:oracle:thin:@10.23.0.100:1521:esgdb10", "scott", "tiger");
		System.out.println("connection established");

		Statement stmt = con.createStatement();
		System.out.println("statement created..");
		ResultSet rs = stmt.executeQuery("SELECT * FROM myTabKJ");
		ResultSetMetaData rsmd = rs.getMetaData();
		System.out.println(rsmd.getColumnCount());
	}
}
